/*
 * @Description: 
 * @Author: @yangwenshan
 * @since: 2021-05-17 08:54:48
 * @LastAuthor: @yangwenshan
 * @lastTime: 2021-05-19 09:55:04
 */
import request from '@/utils/request'

const api = {
    list: '/question/',
    distribute: '/replay/distribute/'
}

//获取题目列表
export function getQuestionList(params) {
    return request({
        url: api.list,
        method: 'get',
        params
    })
}

//获取题目列表
export function getQuestionDetail(id) {
    return request({
        url: `${api.list}${id}/`,
        method: 'get',
    })
}

//新增题目
export function addQuestion(data) {
    return request({ url: api.list, method: 'post', data })
}

//删除题目
export function deleteQuestion(id) {
    return request({ url: `${api.list}${id}/`, method: 'delete' })
}

//修改题目
export function updateQuestion(id, data) {
    return request({ url: `${api.list}${id}/`, method: 'patch', data })
}

//分配题目
export function distributeQuestion(data) {
    return request({ url: api.distribute, method: 'post', data })
}